package com.qk.management.mapper;

import com.qk.domain.user.UserDO;
import com.qk.dto.user.UserDTO;
import com.qk.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 *
 * @author MrZhao
 * @created 2025-10-07 18:16
 * @description 用户管理Mapper接口
 *
 */
@Mapper
public interface UserMapper {
    /**
     * 新增用户
     * @param user
     */
    void insert(User user);
    /**
     *  分页条件查询列表
     * @param dto 分页条件
     * @return List<UserDO>
     */
    List<UserDO> selectByPage(UserDTO dto);


    void DeleteUser(List<Integer> ids);

    @Select("select * from user where id=#{id}")
    User getUserById(Integer id);

    void updateUser(User user);

    @Select("select * from user where username=#{username}")
    User getUserByUsername(String username);

    @Select("select * from user")
    List<User> selectAll();

    @Select("select * from user where role_id=#{id}")
    List<User> selectRoleLabel(Integer id);

    List<User> selectDept(Integer deptId);
}
